/**
 * Project Name:framework-webapi
 * File Name:ListResult.java
 * Package Name:cn.easysw.framework.webapi.domain
 * Date:2015年11月25日下午3:49:47
 * Copyright (c) 2015, www.windo-soft.com All Rights Reserved.
 */

package ink.tiptop.common.domain;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * ClassName:ListResult <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON. <br/>
 * Date: 2015年11月25日 下午3:49:47 <br/>
 *
 * @author Roy.Wong
 * @see
 * @since JDK 1.6
 */
public class ListBody<T> extends BaseDomain {

    /**
     * serialVersionUID:TODO(用一句话描述这个变量表示什么).
     *
     * @since JDK 1.6
     */
    private static final long serialVersionUID = 1L;

    @JsonProperty("LIST")
    List<T> list;

    @JsonProperty("COUNT")
    Integer count;

    public ListBody(List<T> list) {
        this.list = list;
        if (list == null) {
            count = 0;
        } else {
            count = list.size();
        }
    }

    public ListBody(List<T> list, int count) {
        this.list = list;
        this.count = count;
    }

    public List<T> getList() {
        return list;
    }

    public Integer getCount() {
        return count;
    }

}
